package com.song.ResourceNode.thread;

import java.util.List;
import java.util.concurrent.Callable;

import com.alibaba.fastjson.JSON;
import com.song.ResourceNode.client.NodeClient;
import com.song.corebean.Host;
import com.song.corebean.MessageType;
import com.song.corebean.PackageHead;

public class FetchThread  implements Callable<Object>{
	
	private List data;
	
	private Host host;

	public FetchThread(Host host , List data) {
		super();
		this.data = data;
		this.host = host;
	}

	public Object call() throws Exception {
		
		NodeClient client = new NodeClient();
		client.connect(host.getAddress(),host.getPort());
		Object result = client.sendAndRecv(MessageType.DEAL_SEG_DATA,"data",data);
		client.release();
		return result;
	}
	
	
	
	
}
